import request from '@/config/axios'

// 发布离职通告 VO
export interface LeaveInfoVO {
  id: number // 主键ID
  userId: number // 用户id
  infoName: string // 信息名称
  realName: string // 姓名
  idCard: string // 身份证
  sex: string // 性别
  birthday: string // 出生日期
  age: number // 年龄
  image: string // 单图
  images: string // 多图
  description: string // 描述
  isTop: number // 置顶
  sort: number // 排序
  audit: number //审核状态
  nickname: string //
}

// 发布离职通告 API
export const LeaveInfoApi = {
  // 查询发布离职通告分页
  getLeaveInfoPage: async (params: any) => {
    return await request.get({ url: `/wine/leave-info/page`, params })
  },

  // 查询发布离职通告详情
  getLeaveInfo: async (id: number) => {
    return await request.get({ url: `/wine/leave-info/get?id=` + id })
  },

 // 审核离职通知
  getAudit: async (id: number) => {
    return await request.put({ url: `/wine/leave-info/update?id=` + id })
  },

  // 新增发布离职通告
  createLeaveInfo: async (data: LeaveInfoVO) => {
    return await request.post({ url: `/wine/leave-info/create`, data })
  },

  // 修改发布离职通告
  updateLeaveInfo: async (data: LeaveInfoVO) => {
    return await request.put({ url: `/wine/leave-info/update`, data })
  },

  // 删除发布离职通告
  deleteLeaveInfo: async (id: number) => {
    return await request.delete({ url: `/wine/leave-info/delete?id=` + id })
  },

  // 导出发布离职通告 Excel
  exportLeaveInfo: async (params) => {
    return await request.download({ url: `/wine/leave-info/export-excel`, params })
  }
}
